package mediator;

/**
 * @Author shenhan
 * @Date: 2020/4/10 22:35
 * @Description:
 */
public class Alarm extends Colleague {

    public Alarm(Mediator mediator, String name) {
        super(mediator, name);
        mediator.register(name, this);
    }

    @Override
    public void sendMessage(int stateChange) {
        this.getMediator().getMessage(stateChange, this.getName());
    }

    public void sendAlarm(int stateChange) {
        sendMessage(stateChange);
    }
}
